package com.lqzs.businessmanager.bean;


import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

import java.io.Serializable;
import java.util.Objects;

@Entity(tableName = "reply_table")
public class ReplyInfo implements Serializable {

    @PrimaryKey(autoGenerate = true)
    private int pId;
    @ColumnInfo
    private String id;
    // 评论人
    @ColumnInfo(name = "reviewer")
    private String reviewer = "";
    @ColumnInfo(name = "review_date")
    private String reviewDate = "";
    // 评论id
    @ColumnInfo(name = "review_id")
    private String reviewId ="";
    // 分店 ID
    @ColumnInfo(name = "branch_id")
    private int branchId;
    // 评论信息
    @ColumnInfo(name = "reviewer_infos")
    private String reviewerInfos = "";
    // 订单信息
    @ColumnInfo(name = "order_infos")
    private String orderInfos = "";
    // 追评信息
    @ColumnInfo(name = "append_infos")
    private String appendInfos = "";
    // 回复信息
    @ColumnInfo(name = "reply_content")
    private String replyContent = "";
    // 状态-1新评论，0有回复，1 已回复，2 原有回复
    @ColumnInfo(name = "state")
    private int state = 0;
    // 平台名称
    @ColumnInfo(name = "platform_name")
    private String platformName = "";
    // 分店名称
    @ColumnInfo(name = "branch_name")
    private String branchName = "";


    public int getPId() {
        return pId;
    }

    public void setPId(int pId) {
        this.pId = pId;
    }

    @NonNull
    public String getId() {
        return id;
    }

    public void setId(@NonNull String id) {
        this.id = id;
    }

    public String getReviewer() {
        return reviewer;
    }

    public void setReviewer(String reviewer) {
        this.reviewer = reviewer;
    }

    public String getReviewDate() {
        return reviewDate;
    }

    public void setReviewDate(String reviewDate) {
        this.reviewDate = reviewDate;
    }

    public String getReviewId() {
        return reviewId;
    }

    public void setReviewId(String reviewId) {
        this.reviewId = reviewId;
    }

    public int getBranchId() {
        return branchId;
    }

    public void setBranchId(int branchId) {
        this.branchId = branchId;
    }

    public String getReviewerInfos() {
        return reviewerInfos;
    }

    public void setReviewerInfos(String reviewerInfos) {
        this.reviewerInfos = reviewerInfos;
    }

    public String getOrderInfos() {
        return orderInfos;
    }

    public void setOrderInfos(String orderInfos) {
        this.orderInfos = orderInfos;
    }

    public String getAppendInfos() {
        return appendInfos;
    }

    public void setAppendInfos(String appendInfos) {
        this.appendInfos = appendInfos;
    }

    public String getReplyContent() {
        return replyContent;
    }

    public void setReplyContent(String replyContent) {
        this.replyContent = replyContent;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getPlatformName() {
        return platformName;
    }

    public void setPlatformName(String platformName) {
        this.platformName = platformName;
    }

    public String getBranchName() {
        return branchName;
    }

    public void setBranchName(String branchName) {
        this.branchName = branchName;
    }

    public String getKey() {
        return this.reviewer + "@" + reviewDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ReplyInfo)) return false;
        ReplyInfo replyInfo = (ReplyInfo) o;
        return Objects.equals(reviewDate, replyInfo.reviewDate) && Objects.equals(reviewer, replyInfo.reviewer);
    }

    @Override
    public int hashCode() {
        return Objects.hash(reviewer, reviewDate);
    }

    @NonNull
    @Override
    public String toString() {
        return "ReplyInfo{" +
                "pId=" + pId +
                ", id='" + id + '\'' +
                ", reviewer='" + reviewer + '\'' +
                ", reviewDate='" + reviewDate + '\'' +
                ", reviewId='" + reviewId + '\'' +
                ", branchId=" + branchId +
                ", reviewerInfos='" + reviewerInfos + '\'' +
                ", orderInfos='" + orderInfos + '\'' +
                ", appendInfos='" + appendInfos + '\'' +
                ", replyContent='" + replyContent + '\'' +
                ", state=" + state +
                ", platformName='" + platformName + '\'' +
                ", branchName='" + branchName + '\'' +
                '}';
    }
}
